package coreentity

import (
	"core/class"
	"core/datetime"
	"core/selfreg"
	"reflect"
)

type HtMenu struct {
	Id int64 `json:"id,string"                         gorm:"column:id;primaryKey;comment:主键;autoIncrement:false;"`

	Name string `json:"name"         validate:"required,max=50"gorm:"column:name;size:50;DEFAULT:'';not null;comment:菜单名称;"`

	Pid      int64  `json:"pid,string"                       gorm:"column:pid;DEFAULT:0;not null;comment:父编号;"`
	HtplatId int64  `json:"htplatId,string"                    gorm:"column:htplat_id;DEFAULT:0;not null;comment:平台编号;"`
	Code     string `json:"code"         validate:"max=50"   gorm:"column:code;size:50;DEFAULT:'';not null;comment:菜单代码;"`

	Lx         string `json:"lx"           validate:"max=10"   gorm:"column:lx;size:10;DEFAULT:'';not null;comment:类型;memo:菜单、页面、权限;"`
	HtpageId   int64  `json:"htpageId,string"                    gorm:"column:htpage_id;DEFAULT:0;not null;comment:页面编号;"`
	HtactionId int64  `json:"htactionId,string"                    gorm:"column:htaction_id;DEFAULT:0;not null;comment:Url编号;"`
	Imgurl     string `json:"imgurl"                           gorm:"column:imgurl;DEFAULT:'';not null;comment:图标;"`
	P1         string `json:"p1"           validate:"max=50"   gorm:"column:p_1;size:50;DEFAULT:'';not null;comment:参数1;"`
	P2         string `json:"p2"           validate:"max=50"   gorm:"column:p_2;size:50;DEFAULT:'';not null;comment:参数2;"`
	P3         string `json:"p3"           validate:"max=50"   gorm:"column:p_3;size:50;DEFAULT:'';not null;comment:参数3;"`
	P4         string `json:"p4"           validate:"max=50"   gorm:"column:p_4;size:50;DEFAULT:'';not null;comment:参数4;"`
	Sortno     int64  `json:"sortno,string"                    gorm:"column:sortno;DEFAULT:0;not null;comment:排序号;"`
	Memo       string `json:"memo"                             gorm:"column:memo;DEFAULT:'';not null;comment:备注;"`

	CrtDt   datetime.MyTime    `json:"crtDt"                            gorm:"column:crt_dt;not null;comment:创建日期;"`
	CrtUid  int64              `json:"crtUid,string"                    gorm:"column:crt_uid;DEFAULT:0;not null;comment:创建人编号;"`
	CrtDid  int64              `json:"crtDid,string"                    gorm:"column:crt_did;DEFAULT:0;not null;comment:机构编号;"`
	EdtDt   datetime.MyTime    `json:"edtDt"                            gorm:"column:edt_dt;not null;comment:修改日期;"`
	EdtUid  int64              `json:"edtUid,string"                    gorm:"column:edt_uid;DEFAULT:0;not null;comment:修改人编号;"`
	Gid     string             `json:"gid"                              gorm:"column:gid;DEFAULT:'';type:char(36);not null;comment:Gid;"`
	Deleted datetime.DeletedAt `json:"deleted"                          gorm:"column:deleted;DEFAULT:0;type:tinyint(1);not null;comment:删除标志;"`
}

func (p *HtMenu) TableName() string {
	return "HtMenu"
}

func init() {

	var mcls = &HtMenu{}
	var m = &class.MyClass{
		Name:     "菜单表",
		Ename:    "",
		FullName: "",
		Memo:     "",
		Fileds:   nil,
		PrjName:  "",
		Type:     reflect.TypeOf(mcls),
	}
	selfreg.AddEntity(m)
}
